import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
  UpdateDateColumn,
} from "typeorm";

@Entity({ name: "user" })
export class UserEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column("varchar", { length: 255, nullable: true, unique: true })
  username: string;

  @Column("varchar", { length: 255, nullable: true, select: false })
  password: string;

  @Column("varchar", { length: 255, nullable: true })
  avatar: string;

  @Column("int", { default: 0 })
  status: number;

  @CreateDateColumn({ type: "datetime" })
  createAt: Date;

  @UpdateDateColumn({ type: "datetime" })
  updateAt: Date;
}
